package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpYAccountUserProfileDefaultPageUtil extends SeleniumPageUtil {
	public final static By YAUP_SPAN_HEADER = By.id("ctl44_hdrMain_lblHeader");
	public final static By YAUP_SPAN_USER_NAME = By.id("ctl44_lblUserDisplayName");
	public final static By YAUP_SPAN_USER_LOCATION = By.id("ctl44_lblUserLocation");
	public final static By YAUP_TAB_CHANGE_PASSWORD = By.id("ctl44_ParentChildContainer_tabMenu_ctl44_ParentChildContainer_tabMenuLB_94c18cea-54c8-4cef-807a-89d15835b2f9");
	public final static By YAUP_TAB_SECURITY_ROLE = By.id("ctl44_ParentChildContainer_tabMenu_ctl44_ParentChildContainer_tabMenuLB_acfc794c-832c-447f-a8a2-d37ecac887de");
	public final static By YAUP_TAB_DEFAULTS = By.id("ctl44_ParentChildContainer_tabMenu_ctl44_ParentChildContainer_tabMenuLB_5eb697f3-a7bd-4de5-afb6-9b1ffa6c76d3");
	public final static By YAUP_TAB_CONTACT_DETAILS = By.id("ctl44_ParentChildContainer_tabMenu_ctl44_ParentChildContainer_tabMenuLB_d0b08d53-63bf-4e90-ab8e-604d54ff77cc");
	public final static By YAUP_TAB_MOBILE = By.id("ctl44_ParentChildContainer_tabMenu_ctl44_ParentChildContainer_tabMenuLB_db058199-7d86-4ecb-a490-2511e5d5aca9");
	public final static By YAUP_TAB_ORG_CHART = By.id("ctl44_ParentChildContainer_tabMenu_ctl44_ParentChildContainer_tabMenuLB_c82b5068-07ac-4c12-8eb2-8410c834ad1b");
	
	// check boxes
	public final static By YAUP_INPUT_CHECK_BOXES = By.xpath("//*[@id='ctl44_ParentChildContainer_UserProfile_Defaults1_WarehouseReport_ReportOutput']/table/tbody/tr/td[3]/input");
	
	public static void enterYourAccountUserProfileDefaultPage(){
		SpHomePageUtil.enter();
		SpHomePageUtil.changeCustomer("SMS MASTER");
		SpHomePageUtil.enterYourAccountUserProfileDefaultPage();
		waitForUserProfileDefaultPageToLoad();
	}
	
	public static void waitForUserProfileDefaultPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				YAUP_TAB_CHANGE_PASSWORD, YAUP_SPAN_USER_NAME, YAUP_SPAN_USER_LOCATION, YAUP_TAB_CHANGE_PASSWORD, YAUP_TAB_SECURITY_ROLE,
				YAUP_TAB_DEFAULTS, YAUP_TAB_CONTACT_DETAILS, YAUP_TAB_MOBILE, YAUP_TAB_ORG_CHART 
			});
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YAUP_TAB_CHANGE_PASSWORD));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YAUP_SPAN_USER_NAME));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YAUP_SPAN_USER_LOCATION));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YAUP_TAB_CHANGE_PASSWORD));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YAUP_TAB_SECURITY_ROLE));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YAUP_TAB_DEFAULTS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YAUP_TAB_CONTACT_DETAILS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YAUP_TAB_MOBILE));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(YAUP_TAB_ORG_CHART));
	}
}
